import type { App } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import { useConfigStore } from './modules/config'

const pinia = createPinia()

pinia.use(piniaPluginPersistedstate)

export async function setupStore(app: App<Element>) {
  app.use(pinia)
  useConfigStore().loadConfig()
}
